// 二级菜单显隐：
$(".all-btn").hover(
	function(){
		$(".submenu").css("display","block");
		$(".thrmenu").css({"display":"none"});
		$(".all-btn").css("cursor","pointer");
	},
	function(){
		$(".submenu").css("display","none");
	}
);
// 三级菜单显隐：
var $olis = $(".submenu li" );
$olis.each(function(){
	$(this).hover(function(){		
		$(".thrmenu").css({"display":"block","box-shadow":"0 0 4px #666"})
		$olis.css("box-shadow","none");
		$(this).css({"box-shadow":"0 0 4px #666","padding":"0 15px"})
	},
	function(){
		$(".thrmenu").css("display","none");
	})
})

//  放大镜：
var odiv1 = document.getElementById("div1");
var odiv2 = document.getElementById("div2");
var oglass = document.getElementById("glass");
var oImg1 = document.getElementById("big-pic1");
var oImg2 = document.getElementById("big-pic2");
oImg2.src =oImg1.src;
odiv1.onmousemove = function(event){
	var event = event || window.event;
	var x = event.pageX - odiv1.offsetLeft -oglass.offsetWidth/2;
	var y = event.pageY - odiv1.offsetTop - oglass.offsetHeight/2;
	if(x < 0){
		x = 0;
	}
	if( x > odiv1.offsetWidth - oglass.offsetWidth){
		x = odiv1.offsetWidth - oglass.offsetWidth
	}
	if(y < 0){
		y = 0;
	}
	if(y > odiv1.offsetHeight - oglass.offsetHeight){
		y = odiv1.offsetHeight - oglass.offsetHeight
	}
	oglass.style.left = x + "px";
	oglass.style.top = y + "px";
	oImg2.style.left = -2 * x +"px";
	oImg2.style.top = -2 *y +"px";
}
odiv1.onmouseover = function(){
	oglass.style.display = "block";
	odiv2.style.display = "block";
}
odiv1.onmouseout = function(){
	oglass.style.display = "none";
	odiv2.style.display = "none";
}



$(".picture li").each(function(index,value){
	$(this).hover(function(){
		$("#big-pic").src = $(this).src;
		$(this).css({"cursor":"pointer","border":"1px solid red"})
	},function(){	
		$(this).css({"border":"1px solid #999"})
	})
})

  	
	

	
	
	
	
	
	